/* -*- C++ -*- */
/*===========================================================
 
 .---=||||[ B L O O D Y ]|||||=====================----------....
 |                                                              |
 |    THE  M O S T   B L O O D Y  GAME EVER!                    |
 |                                                              |
 |    bloody harvest is coming... soon,                         |
 |                                              heil Satan!     |
 !                                                              !
 .                                                              ,
  ~~~~-------------================================|||||||||==-~




 Name-Space: {core, logic, editor}
 Module: {draw, coll, scgr, ...}
 Class: <name of class>
 Last modification:  <author>, <time>

 TODO:
 <-------- todo #1 ---------->
 <-------- todo #2 ---------->
 <-------- todo #3 ---------->
        ............
 <-------- todo #n ---------->

 FIX:
 <-------- fix #1 ----------->
 <-------- fix #1 ----------->
         ..........
 <-------- fix #n ----------->




 
 
 ============================================================*/
#ifndef __draw__Material_Header_File
#define __draw__Material_Header_File

#include "common.h"
#include "core/vmath.h"
#include "core/Config.h"
#include "core/draw/Texture.h"

namespace core
{
	namespace draw
	{


		class Material
		{
				Vector4f	ambient;
				Vector4f	specular;
				Vector4f	diffuse;
				Vector4f	emissive;
				float		shininess;
				Texture*	texture;
			public:	
				enum MaterialSet {Nothing = 0x0000,
													Ambient = 0x0001, Specular = 0x0002, 
													Diffuse = 0x0004, Emissive = 0x0008, 
													Shininess = 0x0010};
			private:
				MaterialSet materialType;
			public:
				Material();
				virtual ~Material();
	
				Vector4f getAmbient(){ return ambient; }
				Vector4f getSpecular(){ return specular; }
				Vector4f getDiffuse(){ return diffuse; }
				Vector4f getEmissive(){ return emissive; }
				float getShininess(){ return shininess; }
				Texture* getTexture(){ return texture; }
	
				void setAmbient(Vector4f value){ ambient = value; }
				void setSpecular(Vector4f value){ specular = value; }
				void setDiffuse(Vector4f value){ diffuse = value; }
				void setEmissive(Vector4f value){ emissive = value; }
				void setShininess(float value){ shininess = value; }
				void setTexture(Texture* value){ texture = value; }
	
				MaterialSet getMaterialType(){ return materialType; }
				void setMaterialType(MaterialSet value){ materialType = value; }
	
	
				void bind();

				static Material* fromConfig(const Config& cfg); 
		
		};

	}
}

#endif //__draw__Material_Header_File
